<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use SoftDeletes;//开启软删除

    protected $connection = 'mysql_thor';

    protected $dates=['deleted_at'];
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
       // 'name', 'email', 'mobile',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password',
    ];

    public function admin()
    {
        return $this->belongsTo(AdminUser::class, 'admin_id')->withTrashed();
    }
    public function channel()
    {
        return $this->belongsTo(Channel::class, 'channel_id')->withTrashed();
    }

    public function auditor()
    {
        return $this->belongsTo(AdminUser::class,'auditor_id');
    }

    public function order(){
        return $this->hasMany(Order::class);
    }
    public function bindcard(){
        return $this->hasOne(BindCard::class);
    }

}
